<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
    <style>
        .ball{
            width: 100px;
            height: 100px;
            border: 1px solid #000;
            border-radius: 50%;
        }
    </style>
</head>
<body>
    <div id="root">
        <div class="ball" :style="{backgroundColor:activeBgc}"></div>
        <div>
            <button @click="activeBgc='#f00'">红色</button>
            <button @click="activeBgc='#0f0'">绿色</button>
            <button @click="activeBgc='#00f'">蓝色</button>
        </div>
    </div>
    <script>
        new Vue({
            el:'#root',
            data(){
                return{
                    activeBgc:'#ccc'
                }
            }
        })
    </script>
</body>
</html>